<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Guaripolo Store</title>
<meta name="description" content="My Store" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/960.css" media="all" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/color.css" media="screen" />

<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="stylesheet/ie.css" media="screen" />
<![endif]-->

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/shoppica.js"></script>
</head>



<body class="s_layout_fixed">



<div id="wrapper"> 

  

  <!-- ********************** --> 

  <!--      H E A D E R       --> 

  <!-- ********************** -->

  <div id="header" class="container_12">
    <div class="grid_12">
    
    	<a id="site_logo" href="index.html">Guaripolo Store</a> 

     <div id="system_navigation" class="s_nav">
        <ul class="s_list_1 clearfix">
          <li><a href="<?php echo base_url()."catalogo"?>">Inicio</a></li>
          <li><a href="<?php echo base_url()."home/logout"?>">Log Out</a></li>
          <li><a href="<?php echo base_url()."carrito"?>">Carro de compras</a></li>
          <li><a href="<?php echo base_url()."historial"?>">Historial</a></li>
          
        </ul>
      </div>

      <div id="site_search">
      	<a id="show_search" href="javascript:;" title="Search:"></a>
        <div id="search_bar" class="clearfix">
          <input type="text" id="filter_keyword" />
          <select id="filter_category_id">
            <option value="0">Todas las categorias</option>
            <option value="1">PC</option>
            <option value="2">XBOX 360</option>
            <option value="1">PS3</option>
          </select>
          <a class="s_button_1 s_secondary_color_bgr"><span class="s_text">Go</span></a> 
        </div>
      </div>
      
      <div id="categories" class="s_nav">
        <ul>
          <li id="menu_home"> <a <?php echo base_url()."catalogo"?>>Inicio</a> </li>
          <li> <a href="<?php echo base_url()."catalogo"?>">Juegos</a>
            <div class="s_submenu">
              <h3>Categorias</h3>
              <ul class="s_list_1 clearfix">
                <li> <a href="#">Accion</a>
                  
                </li>
                <li><a href="#">Peleas</a></li>
                <li><a href="#">Deporte</a></li>
              </ul>
              <span class="clear border_eee"></span>
              
        </ul>
      </div>
      
      <div id="cart_menu" class="s_nav">
      	<a href="/carrito"><span class="s_icon"></span> <small class="s_text">Carro</small><span class="s_grand_total s_main_color">
      	 $<?php 
      	$t=0; 
      	$nitems=0;
      	$q=$this->usuario->getCarro()->getAllProductos();
      	foreach($q->result() as $row)
      	{
      		$t+=$row->Precio * $row->cantidad;
      		$nitems+=$row->cantidad;
      	}
      	
      	echo $t;
      	?></span></a>
        <div class="s_submenu s_cart_holder">
          <p class="s_mb_0"><?php echo $nitems?> Juegos</p>
        </div>
      </div>
      
    </div>
  </div>

  <!-- end of header --> 

  



  <!-- ********************** --> 

  <!--     I N T R O          -->

  <!-- ********************** --> 

  <div id="intro">

    <div id="intro_wrap">

      <div class="container_12">

        <div id="breadcrumbs" class="grid_12">

          <a href="<?php echo base_url()."catalogo"?>">Inicio</a>

           &gt; <a href="<?php echo base_url()."carrito"?>">Carro</a>
           
            &gt; <a href="<?php echo base_url()."historial"?>">Historial</a>

        </div>

        <h1>Historial</h1>

      </div>

    </div>

  </div>

  <!-- end of intro -->

  

  

  <!-- ********************** --> 

  <!--      C O N T E N T     --> 

  <!-- ********************** --> 

  <div id="content" class="container_12">

  

    <div id="shopping_cart" class="grid_12">
  

        
        
        
        
        <!-- 
        
        
        
        
        
        -->
        
        <?php 
        
  				$id=-1;
  				$total=0;
  				$html="";
        		foreach($data as $row)
        		{
        			if($row->carro_historico_id!=$id)
        			{
	        			
	        			if($id!=-1)
	        			{
	        				$html=$html.'
	        				<tr>
	        				<td colspan=\'4\' style=\'text-align:right\'>
	        					<h3>  Total: $'.$total.'</h3>
	        					</td>
	        			
	        				</tr>
	        				</table>
	        				<br></div>';
	        				echo'
	        				<tr>
	        				<td colspan="4" style="text-align:right">
	        					<h3>  Total: $'.$total.'</h3>
	        					</td>
	        					
	        				<td colspan="1" style="text-align:left">
	        				<FORM ACTION="detalle/pdf" METHOD="POST"> 
	        				<input name="id" value="'.$id.'" type="hidden"/>
	        				<input name="html" value="'.$html.'" type="hidden"/>
	        					<button class="s_button_1 s_main_color_bgr" type="submit" onclick=""><span class="s_text">Descargar PDF</span></button>
								</FORM>
								</td>
	        				</tr>
	        				</table>
	        				<br></div>';
	        				
	        				
	        			}
	        			$html='';
	        			$total=0;
	        			$id=$row->carro_historico_id;
	        			
	        			if($row->status==1)
	        			{
	        				$medio="Paypal";
	        			}
	        			else if($row->status==2)
	        			{
	        				$medio="Socialpay";
	        			}
	        			$html=$html.'<h1>store:'.$row->carro_historico_id.'</h1> <h3>'.$row->fecha.' '.$medio.'</h3>';
	        			echo '<h1>store:'.$row->carro_historico_id.'</h1> <h3>'.$row->fecha.' '.$medio.'</h3>';
	        			
	        			$html=$html.'<div id='.$id.'>
			        			<table class=\'s_table_1\'  cellpadding=\'0\' cellspacing=\'0\' border=\'0px\'>
						          <tr>
						            <th  width=\'180px\'>Imagen</th>
						            <th width=\'280px\'>Nombre</th>
						            <th width=\'100px\'>Cantidad</th>
						            <th width=\'100px\'>Precio unidad</th>
						          </tr>
						          <tr class=\'even\'>
						            <td align=\'center\' valign=\'middle\' ><img alt=\'Embedded Image\' src=\'data:image/jpeg;base64,'.base64_encode($row->Img).'\' width=\'180px\' height=\'90px\' alt=\'\' /></td>
						            <td align=\'center\' valign=\'middle\'>'.$row->Nombre.'</td>
						            <td align=\'center\' valign=\'middle\'>'.$row->cantidad.'</td>
						            <td align=\'center\' valign=\'middle\'>'.$row->Precio.'</td>
						          </tr>
	        			';	        			
	        			echo '<div id='.$id.'>
			        			<table class="s_table_1" width="100%" cellpadding="0" cellspacing="0" border="0">
						          <tr>
						            <th  width="210">Imagen</th>
						            <th width="280">Nombre</th>
						            <th>Plataforma</th>
						            <th>Cantidad</th>
						            <th>Precio unidad</th>
						          </tr>
						          <tr class="even">
						            <td valign="middle" ><img alt="Embedded Image" src="data:image/jpeg;base64,'.base64_encode($row->Img).'" width="200" height="100" alt="" /></td>
						            <td valign="middle">'.$row->Nombre.'</td>
						            <td valign="middle">'.$row->Plataforma.'</td>
						            <td valign="middle">'.$row->cantidad.'</td>
						            <td valign="middle">'.$row->Precio.'</td>
						          </tr>
	        			';
	        			$total+=$row->Precio*$row->cantidad;
	        			
        			}
        			else
        			{
        				$html=$html.'
        					   <tr class=\'even\'>
						            <td align=\'center\' valign=\'middle\' ><img alt=\'Embedded Image\' src=\'data:image/jpeg;base64,'.base64_encode($row->Img).'\' width=\'180px\' height=\'90px\' alt=\'\' /></td>
						            <td align=\'center\' valign=\'middle\'>'.$row->Nombre.'</td>
						            <td align=\'center\' valign=\'middle\'>'.$row->cantidad.'</td>
						            <td align=\'center\' valign=\'middle\'>'.$row->Precio.'</td>
						          </tr>	
        				';
        				echo '
        					 <tr class="even">
					            <td valign="middle" ><img alt="Embedded Image" src="data:image/jpeg;base64,'.base64_encode($row->Img).'" width="200" height="100" alt="" /></td>
					            <td valign="middle">'.$row->Nombre.'</td>
					            <td valign="middle">'.$row->Plataforma.'</td>
					            <td valign="middle">'.$row->cantidad.'</td>
					            <td valign="middle">'.$row->Precio.'</td>
					          </tr>	
        				';
        				$total+=$row->Precio*$row->cantidad;
        			}
        			
        		}
        		if($id!=-1)
        		{
        			$html=$html.'
        			<tr>
        			<td colspan=\'4\' style=\'text-align:right\'>
        			<h3>  Total: $'.$total.'</h3>
        			</td>
        			
        			</tr>
        			</table>
        			<br></div>';
        			
        				echo'
	        				<tr>
	        				<td colspan="4" style="text-align:right">
	        					<h3>  Total: $'.$total.'</h3>
	        					</td>
	        					
	        				<td colspan="1" style="text-align:left">
	        				<FORM ACTION="detalle/pdf" METHOD="POST"> 
	        				<input name="id" value="'.$id.'" type="hidden"/>
	        				<input name="html" value="'.$html.'" type="hidden"/>
	        					<button class="s_button_1 s_main_color_bgr" type="submit" onclick=""><span class="s_text">Descargar PDF</span></button>
								</FORM>
								</td>
	        				</tr>
	        				</table>
	        				<br></div>';
        		}
        		
        ?>
         
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        <!-- 
        
        
        
        
        
        
         -->
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        

        <br />

        
        <p class="s_total s_secondary_color last">
       

                        

        <div class="clear"></div>

        <br />



        <a  href="/catalogo" style="text-align:right" class="s_button_1 s_ddd_bgr left"><div style="text-align:right" class="s_text">Continuar comprando</div></a>
	

      </form>



    </div>



    <div class="clear"></div>

    <br />

    <br />

    

  </div>

  <!-- end of content --> 


  
  <!-- ********************** --> 
  <!--             I N F O    --> 
  <!-- ********************** --> 
  <div id="shop_info">
    <div id="shop_info_wrap">
      <div class="container_12">
        <div id="shop_description" class="grid_3">
          <h2>Guaripolo Store</h2>
          <p>Proyecto de Taller de sistemas de computacíon, tienda virtual.</p>
        </div>
        <div id="shop_contacts" class="grid_3">
          <h2>Contactanos</h2>
          <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
              <td valign="middle"><span class="s_icon_32"><span class="s_icon s_phone_32"></span><br />12345</span></td>
            </tr>
            <tr>
              <td valign="middle"><span class="s_icon_32"><span class="s_icon s_mail_32"></span>contacto@guaripolostore.com <br /> </span></td>
            </tr>
            <tr>
              <td valign="middle"><span class="s_icon_32"><span class="s_icon s_skype_32"></span>guaripolo_store <br /> </span></td>
            </tr>
          </table>
        </div>
        <div id="twitter" class="grid_3">
          <h2>Twitter</h2>
          <ul id="twitter_update_list"><li></li></ul>
        </div>
        <div id="facebook" class="grid_3">
          <h2>Facebook</h2>
          <div class="s_widget_holder">
         
          </div>
        </div>
        <div class="clear"></div>
      </div>
    </div>
  </div>
  <!-- end of shop info --> 
  
  

    <div id="payments" class="right clearfix">
    
    </div>
    <p id="copy">&copy; 2012. Realizado por<a class="blue" href="">Equipo Guaripolo</a>.<br /> <a class="s_main_color" href="">Taller de Sistemas de Computación</a><a href=""></a></p>
  </div>
  <!-- end of FOOTER --> 
  
</div>

<div id="fb-root"></div>

</body>
</html>
  

